package com.xujl.mvcbind.ui.home.model;

import com.xujl.fastlib.base.BaseModel;
import com.xujl.fastlib.base.IControl;
import com.xujl.fastlib.bean.OnDataChange;
import com.xujl.mvcbind.bean.FourMultiEntity;
import com.xujl.mvcbind.bean.OneMultiEntity;
import com.xujl.mvcbind.bean.ProviderMultiEntity;
import com.xujl.mvcbind.bean.ThreeMultiEntity;
import com.xujl.mvcbind.bean.TwoMultiEntity;
import com.xujl.task.RxExecutor;
import com.xujl.task.RxHelper;

import java.util.ArrayList;
import java.util.List;


/**
 * <pre>
 *     author : xujl
 *     e-mail : 597355068@qq.com
 *     time   : 2019/08/20
 *     desc   :
 *     version: 1.0
 * </pre>
 */

public class ComplexFragmentModel extends BaseModel {
    private List<ProviderMultiEntity> mList = new ArrayList<>();

    @Override
    public void init (IControl control) {

    }

    public List<ProviderMultiEntity> getDataList () {
        return mList;
    }

    public void getRefreshData (OnDataChange<List<ProviderMultiEntity>> onDataChange) {
        RxExecutor.getInstance()
                .executeTask(new RxHelper.DelayTask(1000) {
                    @Override
                    public void timeOver () {
                        mList.clear();
                        mList.add(new FourMultiEntity(createFourList()));
                        mList.add(new OneMultiEntity("最热", "热门影视"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124574042&di=ae5a512a40ea125aab3d306869d9417f&imgtype=0&src=http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Farticle%2Fb90c18f53c9331efe6ebddf77f3b2765790095a3.jpg"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124600441&di=f725d90060b29c62b9992eefa63fbfa8&imgtype=0&src=http%3A%2F%2Fattach.bbs.miui.com%2Fforum%2F201310%2F19%2F235356fyjkkugokokczyo0.jpg"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124614366&di=2c833daf1891b692bc157a6abc261110&imgtype=0&src=http%3A%2F%2Fimg8.zol.com.cn%2Fbbs%2Fupload%2F13897%2F13896378.jpg"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124622297&di=e6df6cc7628e663d36e8e0d885822404&imgtype=0&src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2017-10-13%2F59e0270c6ba4e.jpg"));
                        mList.add(new TwoMultiEntity("https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2600354095,3696854858&fm=26&gp=0.jpg"));
                        mList.add(new OneMultiEntity("最新", "最新发布"));
                        mList.add(new ThreeMultiEntity("WIS极润保湿4件套护肤品套装爽肤水乳液霜控油洁面补水保湿男女士", "深层补水新体验，植物角鲨烷、仙人掌提取物、牛油果树果脂等蕴含天然有机功能性成分，增加肌肤防御力，深度补水锁水，改善肌肤粗糙、暗沉等问题，轻松成就富有柔软张力与弹力感的水嫩肌肤", "https://a.vpimg3.com/upload/merchandise/pdcvis/137604/2020/0403/165/c066cbb0-d85e-4732-8ccf-ab8d825da668.jpg"));
                        mList.add(new ThreeMultiEntity("HUAWEI nova 5i 全网通4G手机", "6.4寸自拍极点全面屏，后置全场景AI四摄，前置2400w高清自拍，超广角，4000mAh强劲续航", "https://a.vpimg3.com/upload/merchandise/pdcvis/2019/06/20/158/5a55e4d9-cc57-42f9-aab6-a667dd5d79af.jpg"));
                        mList.add(new ThreeMultiEntity("床上四件套纯棉全棉被套床单床上用品纯棉四件套", "纯棉纤维 手感柔软 细腻亲肤", "https://a.vpimg3.com/upload/merchandise/pdcvis/105239/2020/0311/163/f201bfdd-1826-42cb-ac99-2beff1256a03.jpg"));
                        mList.add(new ThreeMultiEntity("【无涂层 真不锈铁锅】家用铁锅煤气灶专用不粘锅32cm炒菜锅炒锅", "无涂层 真不锈 大口径家用不粘锅。燃气灶 煤气灶专用", "https://a.vpimg3.com/upload/merchandise/pdcvis/614913/2020/0221/43/63fe1dc9-8bf5-4876-afaa-820065bd2eab.jpg"));
                        mList.add(new ThreeMultiEntity("【热销】联想小新Air14超薄本便携学生手提笔记本电脑", "【始于颜值 忠于性能】 ①支持指纹识别，轻松玩转智能世界 ②轻薄金属机身，铝镁合金打造，美到发光 ③浮导式背光键盘，二挡调节，尽在指尖 ④FN+Q快速切换三种模式，随意选择 采用Dolby音箱，身临其境，听觉盛宴", "https://a.vpimg3.com/upload/merchandise/pdcvis/615214/2019/1217/147/1f3df869-66ec-4316-bc11-dae84ac6730e.jpg"));
                        mList.add(new FourMultiEntity(createFourList()));
                        mList.add(new OneMultiEntity("最热", "热门影视"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124574042&di=ae5a512a40ea125aab3d306869d9417f&imgtype=0&src=http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Farticle%2Fb90c18f53c9331efe6ebddf77f3b2765790095a3.jpg"));
                        mList.add(new OneMultiEntity("最热", "热门影视"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124574042&di=ae5a512a40ea125aab3d306869d9417f&imgtype=0&src=http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Farticle%2Fb90c18f53c9331efe6ebddf77f3b2765790095a3.jpg"));
                        mList.add(new OneMultiEntity("最热", "热门影视"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124574042&di=ae5a512a40ea125aab3d306869d9417f&imgtype=0&src=http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Farticle%2Fb90c18f53c9331efe6ebddf77f3b2765790095a3.jpg"));
                        mList.add(new OneMultiEntity("最热", "热门影视"));
                        mList.add(new ThreeMultiEntity("床上四件套纯棉全棉被套床单床上用品纯棉四件套", "纯棉纤维 手感柔软 细腻亲肤", "https://a.vpimg3.com/upload/merchandise/pdcvis/105239/2020/0311/163/f201bfdd-1826-42cb-ac99-2beff1256a03.jpg"));
                        mList.add(new OneMultiEntity("最新", "最新发布"));
                        mList.add(new ThreeMultiEntity("【无涂层 真不锈铁锅】家用铁锅煤气灶专用不粘锅32cm炒菜锅炒锅", "无涂层 真不锈 大口径家用不粘锅。燃气灶 煤气灶专用", "https://a.vpimg3.com/upload/merchandise/pdcvis/614913/2020/0221/43/63fe1dc9-8bf5-4876-afaa-820065bd2eab.jpg"));
                        mList.add(new OneMultiEntity("最新", "最新发布"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124574042&di=ae5a512a40ea125aab3d306869d9417f&imgtype=0&src=http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Farticle%2Fb90c18f53c9331efe6ebddf77f3b2765790095a3.jpg"));
                        mList.add(new OneMultiEntity("最新", "最新发布"));
                        mList.add(new ThreeMultiEntity("WIS极润保湿4件套护肤品套装爽肤水乳液霜控油洁面补水保湿男女士", "深层补水新体验，植物角鲨烷、仙人掌提取物、牛油果树果脂等蕴含天然有机功能性成分，增加肌肤防御力，深度补水锁水，改善肌肤粗糙、暗沉等问题，轻松成就富有柔软张力与弹力感的水嫩肌肤", "https://a.vpimg3.com/upload/merchandise/pdcvis/137604/2020/0403/165/c066cbb0-d85e-4732-8ccf-ab8d825da668.jpg"));
                        mList.add(new OneMultiEntity("最新", "最新发布"));
                        mList.add(new ThreeMultiEntity("【无涂层 真不锈铁锅】家用铁锅煤气灶专用不粘锅32cm炒菜锅炒锅", "无涂层 真不锈 大口径家用不粘锅。燃气灶 煤气灶专用", "https://a.vpimg3.com/upload/merchandise/pdcvis/614913/2020/0221/43/63fe1dc9-8bf5-4876-afaa-820065bd2eab.jpg"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124622297&di=e6df6cc7628e663d36e8e0d885822404&imgtype=0&src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2017-10-13%2F59e0270c6ba4e.jpg"));
                        mList.add(new TwoMultiEntity("https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2600354095,3696854858&fm=26&gp=0.jpg"));
                        mList.add(new ThreeMultiEntity("HUAWEI nova 5i 全网通4G手机", "6.4寸自拍极点全面屏，后置全场景AI四摄，前置2400w高清自拍，超广角，4000mAh强劲续航", "https://a.vpimg3.com/upload/merchandise/pdcvis/2019/06/20/158/5a55e4d9-cc57-42f9-aab6-a667dd5d79af.jpg"));
                        mList.add(new TwoMultiEntity("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1587124600441&di=f725d90060b29c62b9992eefa63fbfa8&imgtype=0&src=http%3A%2F%2Fattach.bbs.miui.com%2Fforum%2F201310%2F19%2F235356fyjkkugokokczyo0.jpg"));
                        mList.add(new FourMultiEntity(createFourList()));
                        onDataChange.onChange(mList);
                    }
                });
    }

    private List<ThreeMultiEntity> createFourList () {
        List<ThreeMultiEntity> list = new ArrayList<>();
        list.add(new ThreeMultiEntity("WIS极润保湿4件套护肤品套装爽肤水乳液霜控油洁面补水保湿男女士", "深层补水新体验，植物角鲨烷、仙人掌提取物、牛油果树果脂等蕴含天然有机功能性成分，增加肌肤防御力，深度补水锁水，改善肌肤粗糙、暗沉等问题，轻松成就富有柔软张力与弹力感的水嫩肌肤", "https://a.vpimg3.com/upload/merchandise/pdcvis/137604/2020/0403/165/c066cbb0-d85e-4732-8ccf-ab8d825da668.jpg"));
        list.add(new ThreeMultiEntity("HUAWEI nova 5i 全网通4G手机", "6.4寸自拍极点全面屏，后置全场景AI四摄，前置2400w高清自拍，超广角，4000mAh强劲续航", "https://a.vpimg3.com/upload/merchandise/pdcvis/2019/06/20/158/5a55e4d9-cc57-42f9-aab6-a667dd5d79af.jpg"));
        list.add(new ThreeMultiEntity("床上四件套纯棉全棉被套床单床上用品纯棉四件套", "纯棉纤维 手感柔软 细腻亲肤", "https://a.vpimg3.com/upload/merchandise/pdcvis/105239/2020/0311/163/f201bfdd-1826-42cb-ac99-2beff1256a03.jpg"));
        list.add(new ThreeMultiEntity("【无涂层 真不锈铁锅】家用铁锅煤气灶专用不粘锅32cm炒菜锅炒锅", "无涂层 真不锈 大口径家用不粘锅。燃气灶 煤气灶专用", "https://a.vpimg3.com/upload/merchandise/pdcvis/614913/2020/0221/43/63fe1dc9-8bf5-4876-afaa-820065bd2eab.jpg"));
        list.add(new ThreeMultiEntity("【热销】联想小新Air14超薄本便携学生手提笔记本电脑", "【始于颜值 忠于性能】 ①支持指纹识别，轻松玩转智能世界 ②轻薄金属机身，铝镁合金打造，美到发光 ③浮导式背光键盘，二挡调节，尽在指尖 ④FN+Q快速切换三种模式，随意选择 采用Dolby音箱，身临其境，听觉盛宴", "https://a.vpimg3.com/upload/merchandise/pdcvis/615214/2019/1217/147/1f3df869-66ec-4316-bc11-dae84ac6730e.jpg"));
        return list;
    }


    public List<Object> getDataObjectList () {
        List<Object> list = new ArrayList<>();
        list.addAll(mList);
        mList.add(new OneMultiEntity("最热", "热门影视"));
        return list;
    }
}
